package br.festasconquista;

import java.util.ArrayList;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

public class FragFestas extends Fragment {
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle saveInstanceState){
		
		View view = inflater.inflate(R.layout.festas, null);
			
		
		ArrayList<Festa_objeto> festas = new ArrayList<Festa_objeto>();

		String[] listaNome = new String[] { "Festa do cu arrombadoooo ","Ted gay Fest ", "Bahia Drug's fest","Rosalvo Virgens fest", "Nando PT Fest","Edgar Gasolina 4 reais Fest","Gugu HIV Fest","Mariana fest","Caio fest doido", "Tamo junto fest" };
		String[] listaHora = new String[] { "12:40", "15:50", "15:55","16:00", "17:30", "18:00", "21:00","22:00","23:00","00:00"};
		String[] listaData = new String[] { "01/11/2014", "01/11/2014", "05/11/2014", "06/11/2014", "07/11/2014", "10/11/2014", "11/11/2014", "25/11/2014", "31/11/2014", "31/11/2014"};
		for (int i = 0; i < 10; i++) {

			Festa_objeto festa = new Festa_objeto();

			festa.setNome(listaNome[i]);
			festa.setHora(listaHora[i]);
			festa.setData(listaData[i]);

			festas.add(festa);
		}
		
		ListView lv = (ListView) view.findViewById(R.id.listView1);
		lv.setAdapter(new FestaAdapter_frag_festas(getActivity().getApplicationContext(), festas));
		
		return view;
	}
}
